<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn" %>
<%@ taglib uri="/WEB-INF/tld/FCKeditor" prefix="FCK" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
  <head>
    <html:base />
    
    <title>修改直播</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
.vb_wid {width:100%; margin: 0 auto; border-top:1px #FDB18D solid; background:#F5F5F5; color:#FE6500; text-indent:20px; line-height:25px; font-size:12px;}
.fb_search {width:90%; margin:0 auto; margin-top:20px; border:1px #FFCD7F solid;}
.fb_search h1 {background:#FFEFBB; margin:0px; padding:0px; line-height:28px; text-indent:10px; font-size:14px;}
.fb_ddd {width:90%; margin:0 auto; margin-top:10px; border-top:3px #FFCC00 solid; background:url(images/pen.gif) no-repeat 5px 3px; height:40px; text-indent:50px; line-height:40px; color:#464646; font-size:12px;}
.fb_nr {width:90%; margin:0 auto; margin-top:10px; line-height:40px; font-size:12px; color:#464646}
.fb_nr span {color:#CCC;}
.fb_nr select {color:464646; font-size:12px;}
.fb_nr Div {margin-left:10px;}
.fb_nr .table11 {border-top:1px #FFCC66 solid; background:#FFF2D7;}
.fb_nr .table22 {border-top:1px #E1E1E1 solid; background:#F9F9F9; margin-left:10px;}
.fb_nr .table33 {border-top:1px #FFCC66 solid; border-bottom:1px #FFCC66 solid; background:#FFF2D7;}
.fb_nr .table44 {border-top:1px #E1E1E1 solid; border-bottom:1px #E1E1E1 solid; background:#F9F9F9; margin-left:10px;}
.inputtttt {border:1px #DEA303 solid; height:20px; color:#464646; font-size:12px; background:url(images/bottom_bg.jpg) repeat-x left top;}
</style>
<script type='text/javascript' src='/dwr/interface/homeSiteDWRServ.js'></script>
<script type='text/javascript' src='/dwr/engine.js'></script>
<script type='text/javascript' src='/dwr/util.js'></script>
<script type="text/javascript">
 function check(){
  var title=document.getElementById('title').value;
  var source=document.getElementById('source').value;
  var directSeedClassid=document.getElementById('directSeedClassid').value;
  var keyword=document.getElementById('keyword').value;
  var writer=document.getElementById('writer').value;
  
  
     if(directSeedClassid==-2||directSeedClassid==null||directSeedClassid==''){
          alert('直播小分类不可以为空！！！');
          return false;
     }
     
     if(title==null||title==''){
          alert('直播标题不可以为空！！！');
          return false;
     }
      if(title.length>25){
          alert('直播标题不可以大于30个字符！！！');
          return false;
     }
     if(keyword==null||keyword==''){
          alert('关键字不可以为空！！！');
          return false;
     }
      if(keyword.length>25){
          alert('关键字不可以大于25个字符！！！');
          return false;
     }
     if(writer==null||writer==''){
          alert('作者不可以为空！！！');
          return false;
     }
      if(writer.length>25){
          alert('作者不可以大于25个字符！！！');
          return false;
     }
      if(source.length>25){
          alert('直播来源不可以大于25个字符！！！');
          return false;
     }
     
    for(var i=0;i<document.all.toptitle.length;i++){
  	if(document.all.toptitle[i].checked&&document.all.toptitle[i].value=='1') {
  	  var js=document.getElementById('js').value;
  	   if(js==null||js==""){
  	      alert('简介不可以为空！！！');
  	      return false;	  		
	 }
  
  }    
  }
   for(var i=0;i<document.all.isimg.length;i++){
  	if(document.all.isimg[i].checked&&document.all.isimg[i].value=='1') {
  	  var imgstr=document.getElementById('imgstr').value;
  	   var hidimgstr=document.getElementById('hidimgstr').value;
  	   if((imgstr==null||imgstr=="")&&(hidimgstr==null||hidimgstr=="")){
  	      alert('请上传图片！！！');
  	      return false;
  	   }
			  		
	 }
  
  }
    return true;
 }
</script>
<script type="text/javascript">

          function getDirectSeedClassMap(obj){
		     homeSiteDWRServ.loadByNameIdMap(obj.value,getAllgetDirectSeedClassMap);
	 	}
	    function getAllgetDirectSeedClassMap(data){
	    
	  	  var magazineClassid = document.getElementById("directSeedClassid");
	      DWRUtil.removeAllOptions(magazineClassid);
	      DWRUtil.addOptions(magazineClassid, {'-2':'请选择直播类别'}); 
	      DWRUtil.addOptions(magazineClassid, data); 
	    }
	    
	    
    function change5(obj1,object2){
     var imgstr1=document.getElementById("imgstr1");
     for(var i=0;i<document.all.isimg.length;i++){
			 if(document.all.isimg[i].checked&&obj1=='0') {
			  		imgstr1.style.display="none";
			 }
			 if(document.all.isimg[i].checked&&obj1=='1') {
			  		imgstr1.style.display="block";
			 }
			
	}
     var jsStr=document.getElementById("jsStr");
     for(var i=0;i<document.all.toptitle.length;i++){
			 if(document.all.toptitle[i].checked&&object2=='0') {
			  		jsStr.style.display="none";
			 }
			 if(document.all.toptitle[i].checked&&object2=='1') {
			  		jsStr.style.display="block";
			 }
			
	}

  }

    function change(){
     var imgstr1=document.getElementById("imgstr1");
     var imgstr=document.getElementById("imgstr");
    for(var i=0;i<document.all.isimg.length;i++){
			 if(document.all.isimg[i].checked&&document.all.isimg[i].value=='0') {
			  		imgstr1.style.display="none";
			  		imgstr.disabled = true;
			  		
			 }
			 if(document.all.isimg[i].checked&&document.all.isimg[i].value=='1') {
			  		imgstr1.style.display="block";
			  		imgstr.disabled = false;
			  		
			 }
	}
  }
  
  
      function changetoptitle(){
     var jsStr=document.getElementById("jsStr");
     var js=document.getElementById("js");
    for(var i=0;i<document.all.toptitle.length;i++){
			 if(document.all.toptitle[i].checked&&document.all.toptitle[i].value=='0') {
			  		jsStr.style.display="none";
			  		js.disabled = true;
			  		
			 }
			 if(document.all.toptitle[i].checked&&document.all.toptitle[i].value=='1') {
			  		jsStr.style.display="block";
			  		js.disabled = false;
			  		
			 }
	}
  }

</script>


  </head>
<body onload="change5('${directSeedForm.isimg}','${directSeedForm.toptitle}');">
<div class="fb_ddd">修改直播</div>
<div class="fb_nr">
   
    <html:form action="/admin/directSeed.do?method=update" onsubmit="return check();" enctype="multipart/form-data">
    <input type="hidden" name="id" value="${directSeedForm.id}"/>
    <input type="hidden" name="bkpage" value="${bkpage}"/>
    <input type="hidden" name="bkpageSize" value="${bkpageSize}"/>
    <input type="hidden" name="bktitle" value="${bktitle}"/>
    <input type="hidden" name="bkcontent" value="${bkcontent}"/>
    <input type="hidden" name="bkkeyword" value="${bkkeyword}"/>
    <input type="hidden" name="bkshanchu" value="${param['bkshanchu']}"/>
    <input type="hidden" name="bkdirectSeedNameid" value="${param['bkdirectSeedNameid']}"/>
   <input type="hidden" name="bkdirectSeedClassid" value="${param['bkdirectSeedClassid']}"/>
   <input type="hidden" name="bktitleStr" value="${param['bktitleStr']}"/>
   <input type="hidden" name="bkyear" value="${param['bkyear']}"/>
   <input type="hidden" name="homesitenewtitle" value="${directSeedForm.webadd}"/>
   
     <table width="100%" border="0">
     
           <tr>
      <td width="17%" align="center" class="table11">直播分类:</td>
      <td width="83%" class="table22"><div><label>
    <html:select property="directSeedNameid" onchange="getDirectSeedClassMap(this);">
    <html:option value="-2" >请选择</html:option>
    <logic:present name="magazineNameList">
    <logic:iterate id="item" name="magazineNameList">
    <option value="${item.id}" <c:if test="${item.id==directSeedNameid}">selected</c:if>>${item.qiname}</option>
    </logic:iterate>
    </logic:present>
    </html:select>-
    <html:select property="directSeedClassid" value="${directSeedClassid}">
    <html:option value="-2" >请选择</html:option>
    
        <c:if test="${directSeedClasslist!=null}">
	      <html:optionsCollection name="directSeedClasslist" label="lanmuname" value="id"/>
	    </c:if>
     </html:select>
     </label></div></td>
	</tr>
     
	 <tr>
      <td align="center" class="table11">新闻标题:</td>
      <td class="table22"><div><label>
         <html:text property="title"></html:text>
         <font color="red">*</font>
          </label></div></td>
       </tr>
	 <tr>
      <td align="center" class="table11">关 键 字:</td>
      <td class="table22"><div><label>
         <html:text property="keyword"></html:text>
        <span>(多个关键字间用&quot;,&quot;逗号隔开)</span></label></div></td>
       </tr>
       

	 <tr>
      <td align="center" class="table11">新闻作者:</td>
      <td class="table22"><div><label>
          <html:text property="writer"></html:text>
          </label></div></td>
       </tr>
	 <tr>
      <td align="center" class="table33">新闻来源:</td>
      <td class="table44"><div><label>
         <html:text property="source"></html:text>
         
          </label></div></td>
       </tr>
       <tr>
       <td align="center" class="table33">是否删除：</td>
      <td class="table44"><div><label>
          <html:radio property="shanchu" value="0" >否</html:radio>
          <html:radio property="shanchu" value="1" >是</html:radio></label></div></td>
       </tr>
       <tr>
       <td align="center" class="table33">是否锁定：</td>
      <td class="table44"><div><label>
          <html:radio property="islock" value="0" >否</html:radio>
          <html:radio property="islock" value="1" >是</html:radio></label></div></td>
       </tr>
       <tr>
       <td align="center" class="table33">是否推荐：</td>
      <td class="table44"><div><label>
          <html:radio property="iscommend" value="0" >否</html:radio>
          <html:radio property="iscommend" value="1" >是</html:radio></label></div></td>
       </tr>
       <tr>
      <td align="center" class="table11">是否头条:</td>
      <td class="table22"><div><label>
         	<html:radio property="toptitle" value="0" onclick="changetoptitle();" >否</html:radio>
			<html:radio property="toptitle" value="1" onclick="changetoptitle();" >是</html:radio></label></div></td>
       </tr>
       
       
       <tr id="jsStr" style="display:none;">
      <td align="center" class="table11">头条简介:</td>
      <td class="table22"><div><label>
      <textarea rows="4" cols="50" name="js">${directSeedForm.js}</textarea>
			</label></div></td>
       </tr>

       <tr>
      <td align="center" class="table11">图片新闻：</td>
      <td class="table22"><div><label>
            <html:radio property="isimg" value="0" onclick="change();">否</html:radio>
			<html:radio property="isimg" value="1" onclick="change();">是</html:radio>
        </label></div></td>
       </tr>
       <tr id="imgstr1" style="display:none;">
        <td align="center" class="table11">图片：</td>
        <td class="table22"><div><label>

         <input type="file" name="imgstr" />
          <input type="hidden" name="hidimgstr" value="${picstr}"/>
         <c:if test="${picstr!=null}">
         <html:link href="/fileUpload/magazine/${picstr}" target="_blank"><font color=green>图片已存在，查看图片</font></html:link>
            </c:if>
         </label></div></td>
       </tr>
       <tr>
        <td align="center" class="table11">新闻内容：</td>
        <td class="table22"><div><label></label></div></td>
	</tr>
					    
	 <tr>
		<td colspan="2">
			<FCK:editor 
			id="content" 
			basePath="/FCKeditor/" 
			width="609" 
			height="593" 
			skinPath="/FCKeditor/editor/skins/silver/" 
			toolbarSet = "Basic">
			${directSeedForm.content}</FCK:editor> 
	   </td>
	 </tr>  
       
       
	   <tr>
         <td></td>
         <td><label>
           <input type="submit" name="Submit" value="提交" class="cpxx_int1" />
           <input type="reset" name="Submit2" value="重置" class="cpxx_int1" />
         </label>
         
         </td>
       </tr>
     </table>
         </html:form>
   <h1><img src="image/qqddc_shop1.gif" width="720" height="8" /></h1>
</div>
</body>
</html:html>
